package com.sojson.controller.po.pay.wx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sojson.result.Result;
import com.sojson.service.pay.PayService;
import com.sojson.util.StringUtil;

import io.swagger.annotations.Api;

/**
 * 微信支付控制器
 * 
 * @author liu
 * @date 2021-03-24
 */
@Api(tags = "微信支付管理")
@RestController
@RequestMapping(value = "/payWx")
public class PayWxController {

    @Autowired
    private PayService payService;

    /**
     * 重新提现
     * 
     * @return
     * @throws Exception 
     */
    @PutMapping("/anewWithdrawDeposit/{orderNo}")
    @PreAuthorize("@ss.hasPermi('/pay/anewWithdrawDeposit/{orderNo}')")
    public Object anewWithdrawDeposit(@PathVariable String orderNo) throws Exception {
        if (StringUtil.isBlank(orderNo)) {
            return Result.fail("订单号不能为空！");
        }

        return Result.success(payService.anewWithdrawDeposit(orderNo));
    }

}